using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkAnalystTools._Analysis
{
    /// <summary>
    /// <para>Make OD Cost Matrix Layer</para>
    /// <para>Makes an origin–destination (OD) cost matrix network analysis layer and sets its analysis properties. An OD cost matrix analysis layer is useful for representing a matrix of costs going from a set of origin locations to a set of destination locations.</para>
    /// <para>创建始发地-目的地 （OD） 成本矩阵网络分析图层并设置其分析属性。OD 成本矩阵分析图层可用于表示从一组始发位置到一组目标位置的成本矩阵。</para>
    /// </summary>    
    [DisplayName("Make OD Cost Matrix Layer")]
    public class MakeODCostMatrixLayer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MakeODCostMatrixLayer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_network_dataset">
        /// <para>Input Analysis Network</para>
        /// <para>The network dataset on which the OD cost matrix analysis will be performed.</para>
        /// <para>将对其执行 OD 成本矩阵分析的网络数据集。</para>
        /// </param>
        /// <param name="_out_network_analysis_layer">
        /// <para>Output Layer Name</para>
        /// <para>Name of the OD cost matrix network analysis layer to create.</para>
        /// <para>要创建的 OD 成本矩阵网络分析图层的名称。</para>
        /// </param>
        /// <param name="_impedance_attribute">
        /// <para>Impedance Attribute</para>
        /// <para>The cost attribute to be used as impedance in the analysis.</para>
        /// <para>在分析中用作阻抗的成本属性。</para>
        /// </param>
        public MakeODCostMatrixLayer(object _in_network_dataset, object _out_network_analysis_layer, object _impedance_attribute)
        {
            this._in_network_dataset = _in_network_dataset;
            this._out_network_analysis_layer = _out_network_analysis_layer;
            this._impedance_attribute = _impedance_attribute;
        }
        public override string ToolboxName => "Network Analyst Tools";

        public override string ToolName => "Make OD Cost Matrix Layer";

        public override string CallName => "na.MakeODCostMatrixLayer";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_network_dataset, _out_network_analysis_layer, _impedance_attribute, _default_cutoff, _default_number_destinations_to_find, _accumulate_attribute_name, _UTurn_policy.GetGPValue(), _restriction_attribute_name, _hierarchy.GetGPValue(), _hierarchy_settings, _output_path_shape.GetGPValue(), _time_of_day, _output_layer];

        /// <summary>
        /// <para>Input Analysis Network</para>
        /// <para>The network dataset on which the OD cost matrix analysis will be performed.</para>
        /// <para>将对其执行 OD 成本矩阵分析的网络数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Analysis Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_network_dataset { get; set; }


        /// <summary>
        /// <para>Output Layer Name</para>
        /// <para>Name of the OD cost matrix network analysis layer to create.</para>
        /// <para>要创建的 OD 成本矩阵网络分析图层的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_network_analysis_layer { get; set; }


        /// <summary>
        /// <para>Impedance Attribute</para>
        /// <para>The cost attribute to be used as impedance in the analysis.</para>
        /// <para>在分析中用作阻抗的成本属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Impedance Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _impedance_attribute { get; set; }


        /// <summary>
        /// <para>Default Cutoff</para>
        /// <para>Default impedance value at which to cut off searching for destinations for a given origin. If the accumulated impedance becomes higher than the cutoff value, the traversal stops. The default can be overridden by specifying the cutoff value on the origins.</para>
        /// <para>默认阻抗值，用于切断对给定源的目的地的搜索。如果累积阻抗高于截止值，则遍历停止。可以通过在原点上指定截止值来覆盖默认值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Default Cutoff")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _default_cutoff { get; set; } = null;


        /// <summary>
        /// <para>Default Number of Destinations to Find</para>
        /// <para>Default number of destinations to find for each origin. The default can be overridden by specifying a value for the TargetDestinationCount property on the origins.</para>
        /// <para>每个起点要查找的默认目的地数。可以通过为源上的 TargetDestinationCount 属性指定值来重写默认值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Default Number of Destinations to Find")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _default_number_destinations_to_find { get; set; } = null;


        /// <summary>
        /// <para>Accumulators</para>
        /// <para><xdoc>
        ///   <para>A list of cost attributes to be accumulated during analysis. These accumulation attributes are for reference only; the solver only uses the cost attribute specified by the Impedance Attribute parameter to calculate the route.</para>
        ///   <para>For each cost attribute that is accumulated, a Total_[Impedance] property is added to the routes that are output by the solver.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在分析期间要累积的成本属性列表。这些累积属性仅供参考;求解器仅使用阻抗属性参数指定的成本属性来计算路由。</para>
        ///   <para>对于累积的每个成本属性，都会将 Total_[Impedance] 属性添加到求解器输出的路径中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Accumulators")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _accumulate_attribute_name { get; set; } = null;


        /// <summary>
        /// <para>U-Turn Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies the U-turn policy that will be used at junctions. Allowing U-turns implies that the solver can turn around at a junction and double back on the same street. Given that junctions represent street intersections and dead ends, different vehicles may be able to turn around at some junctions but not at others—it depends on whether the junction represents an intersection or a dead end. To accommodate this, the U-turn policy parameter is implicitly specified by the number of edges that connect to the junction, which is known as junction valency. The acceptable values for this parameter are listed below; each is followed by a description of its meaning in terms of junction valency.</para>
        ///   <bulletList>
        ///     <bullet_item>Allowed—U-turns are permitted at junctions with any number of connected edges. This is the default value.</bullet_item><para/>
        ///     <bullet_item>Not allowed—U-turns are prohibited at all junctions, regardless of junction valency. However, U-turns are still permitted at network locations even when this setting is chosen, but you can set the individual network location's CurbApproach property to prohibit U-turns there as well.</bullet_item><para/>
        ///     <bullet_item>Allowed at dead ends only—U-turns are prohibited at all junctions, except those that have only one adjacent edge (a dead end).</bullet_item><para/>
        ///     <bullet_item>Allowed at dead ends and intersections only—U-turns are prohibited at junctions where exactly two adjacent edges meet but are permitted at intersections (junctions with three or more adjacent edges) and dead ends (junctions with exactly one adjacent edge). Often, networks have extraneous junctions in the middle of road segments. This option prevents vehicles from making U-turns at these locations.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>If you need a more precisely defined U-turn policy, consider adding a global turn delay evaluator to a network cost attribute or adjusting its settings if one exists, and pay particular attention to the configuration of reverse turns. You can also set the CurbApproach property of your network locations.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将在交汇点使用的 U 形转弯策略。允许掉头意味着求解器可以在交叉路口掉头，并在同一条街道上折返。鉴于交叉路口代表街道交叉路口和死胡同，不同的车辆可能在某些交叉路口掉头，但在其他交叉路口则不能掉头——这取决于交叉路口是代表交叉路口还是死胡同。为了适应这种情况，U 形转弯策略参数由连接到交汇点的边数隐式指定，这称为交汇点化合价。下面列出了此参数的可接受值;每个之后都描述了其在结化合价方面的含义。</para>
        ///   <bulletList>
        ///     <bullet_item>允许 - 允许在具有任意数量连接边的交汇处进行 U 形转弯。这是默认值。</bullet_item><para/>
        ///     <bullet_item>不允许 - 无论交汇点化合价如何，所有交汇点都禁止掉头。但是，即使选择此设置，仍允许在网络位置掉头，但您可以设置单个网络位置的 CurbApproach 属性以禁止掉头。</bullet_item><para/>
        ///     <bullet_item>仅允许在死胡同处 - 所有交汇点都禁止掉头，但只有一个相邻边（死胡同）的交汇点除外。</bullet_item><para/>
        ///     <bullet_item>仅允许在死角和交叉点处 - 在两条相邻边恰好相交的交汇处禁止掉头，但在交叉点（具有三个或更多相邻边的交汇点）和死端（恰好具有一条相邻边的交汇点）允许掉头。通常，网络在路段中间有无关的交叉路口。此选项可防止车辆在这些位置掉头。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>如果需要更精确地定义掉头策略，请考虑将全局转弯延迟评估器添加到网络成本属性或调整其设置（如果存在），并特别注意倒车转弯的配置。还可以设置网络位置的 CurbApproach 属性。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("U-Turn Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _UTurn_policy_value _UTurn_policy { get; set; } = _UTurn_policy_value._ALLOW_UTURNS;

        public enum _UTurn_policy_value
        {
            /// <summary>
            /// <para>Allowed</para>
            /// <para>Allowed—U-turns are permitted at junctions with any number of connected edges. This is the default value.</para>
            /// <para>允许 - 允许在具有任意数量连接边的交汇处进行 U 形转弯。这是默认值。</para>
            /// </summary>
            [Description("Allowed")]
            [GPEnumValue("ALLOW_UTURNS")]
            _ALLOW_UTURNS,

            /// <summary>
            /// <para>Not allowed</para>
            /// <para>Not allowed—U-turns are prohibited at all junctions, regardless of junction valency. However, U-turns are still permitted at network locations even when this setting is chosen, but you can set the individual network location's CurbApproach property to prohibit U-turns there as well.</para>
            /// <para>不允许 - 无论交汇点化合价如何，所有交汇点都禁止掉头。但是，即使选择此设置，仍允许在网络位置掉头，但您可以设置单个网络位置的 CurbApproach 属性以禁止掉头。</para>
            /// </summary>
            [Description("Not allowed")]
            [GPEnumValue("NO_UTURNS")]
            _NO_UTURNS,

            /// <summary>
            /// <para>Allowed at dead ends only</para>
            /// <para>Allowed at dead ends only—U-turns are prohibited at all junctions, except those that have only one adjacent edge (a dead end).</para>
            /// <para>仅允许在死胡同处 - 所有交汇点都禁止掉头，但只有一个相邻边（死胡同）的交汇点除外。</para>
            /// </summary>
            [Description("Allowed at dead ends only")]
            [GPEnumValue("ALLOW_DEAD_ENDS_ONLY")]
            _ALLOW_DEAD_ENDS_ONLY,

            /// <summary>
            /// <para>Allowed at dead ends and intersections only</para>
            /// <para>Allowed at dead ends and intersections only—U-turns are prohibited at junctions where exactly two adjacent edges meet but are permitted at intersections (junctions with three or more adjacent edges) and dead ends (junctions with exactly one adjacent edge). Often, networks have extraneous junctions in the middle of road segments. This option prevents vehicles from making U-turns at these locations.</para>
            /// <para>仅允许在死角和交叉点处 - 在两条相邻边恰好相交的交汇处禁止掉头，但在交叉点（具有三个或更多相邻边的交汇点）和死端（恰好具有一条相邻边的交汇点）允许掉头。通常，网络在路段中间有无关的交叉路口。此选项可防止车辆在这些位置掉头。</para>
            /// </summary>
            [Description("Allowed at dead ends and intersections only")]
            [GPEnumValue("ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY")]
            _ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY,

        }

        /// <summary>
        /// <para>Restrictions</para>
        /// <para>A list of restriction attributes to be applied during the analysis.</para>
        /// <para>在分析期间要应用的限制属性列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Restrictions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _restriction_attribute_name { get; set; } = null;


        /// <summary>
        /// <para>Use Hierarchy in Analysis</para>
        /// <para><xdoc>
        ///   <bulletList>
        ///     <bullet_item>Checked—The hierarchy attribute will be used for the analysis. Using a hierarchy results in the solver preferring higher-order edges to lower-order edges. Hierarchical solves are faster, and they can be used to simulate the preference of a driver who chooses to travel on freeways rather than local roads when possible—even if that means a longer trip. This option is active only if the input network dataset has a hierarchy attribute.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The hierarchy attribute will not be used for the analysis. If hierarchy is not used, the result is an exact route for the network dataset.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>The parameter is inactive if a hierarchy attribute is not defined on the network dataset used to perform the analysis.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <bulletList>
        ///     <bullet_item>选中 - 层次结构属性将用于分析。使用层次结构会导致求解器优先选择高阶边而不是低阶边。分层求解速度更快，并且可用于模拟驾驶员的偏好，如果可能的话，他们选择在高速公路上行驶而不是在本地道路上行驶，即使这意味着更长的行程。仅当输入网络数据集具有层次结构属性时，此选项才处于活动状态。</bullet_item><para/>
        ///     <bullet_item>未选中 - 等级属性将不用于分析。如果未使用层次结构，则结果是网络数据集的精确路径。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>如果未在用于执行分析的网络数据集上定义层次结构属性，则该参数处于非活动状态。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use Hierarchy in Analysis")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _hierarchy_value? _hierarchy { get; set; } = null;

        public enum _hierarchy_value
        {
            /// <summary>
            /// <para>USE_HIERARCHY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_HIERARCHY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_HIERARCHY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_HIERARCHY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Hierarchy Rank Settings</para>
        /// <para>Prior to version 10, this parameter allowed you to change the hierarchy ranges for your analysis from the default hierarchy ranges established in the network dataset. At version 10, this parameter is no longer supported. To change the hierarchy ranges for your analysis, update the default hierarchy ranges in the network dataset.</para>
        /// <para>在版本 10 之前，此参数允许您从网络数据集中建立的默认层次结构范围更改分析的层次结构范围。在版本 10 中，不再支持此参数。要更改分析的层次结构范围，请更新网络数据集中的默认层次结构范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Hierarchy Rank Settings")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _hierarchy_settings { get; set; } = null;


        /// <summary>
        /// <para>Output Path Shape</para>
        /// <para><xdoc>
        ///   <bulletList>
        ///     <bullet_item>No lines—No shape will be generated for the output routes. This is useful when you have a large number of origins and destinations and are interested only in the OD cost matrix table (and not the output line shapes).</bullet_item><para/>
        ///     <bullet_item>Straight lines—The output route shape will be a single straight line between each of the origin-destination pairs.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>No matter which output shape type is chosen, the best route is always determined by the network impedance, never Euclidean distance. This means that only the route shapes are different, not the underlying traversal of the network.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <bulletList>
        ///     <bullet_item>无线 - 不会为输出路径生成任何形状。当您有大量起点和终点，并且只对 OD 成本矩阵表（而不是输出线形状）感兴趣时，这很有用。</bullet_item><para/>
        ///     <bullet_item>直线—输出路径形状将为每个起点-目标对之间的一条直线。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>无论选择哪种输出形状类型，最佳路由始终由网络阻抗决定，而不是欧几里得距离。这意味着只有路由形状不同，而网络的基础遍历不同。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Path Shape")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _output_path_shape_value _output_path_shape { get; set; } = _output_path_shape_value._STRAIGHT_LINES;

        public enum _output_path_shape_value
        {
            /// <summary>
            /// <para>No lines</para>
            /// <para>No lines—No shape will be generated for the output routes. This is useful when you have a large number of origins and destinations and are interested only in the OD cost matrix table (and not the output line shapes).</para>
            /// <para>无线 - 不会为输出路径生成任何形状。当您有大量起点和终点，并且只对 OD 成本矩阵表（而不是输出线形状）感兴趣时，这很有用。</para>
            /// </summary>
            [Description("No lines")]
            [GPEnumValue("NO_LINES")]
            _NO_LINES,

            /// <summary>
            /// <para>Straight lines</para>
            /// <para>Straight lines—The output route shape will be a single straight line between each of the origin-destination pairs.</para>
            /// <para>直线—输出路径形状将为每个起点-目标对之间的一条直线。</para>
            /// </summary>
            [Description("Straight lines")]
            [GPEnumValue("STRAIGHT_LINES")]
            _STRAIGHT_LINES,

        }

        /// <summary>
        /// <para>Start Time</para>
        /// <para><xdoc>
        ///   <para>Indicates the departure time from origins.</para>
        ///   <para>If you have chosen a traffic-based impedance attribute, the solution will be generated given dynamic traffic conditions at the time of day specified here. A date and time can be specified as 5/14/2012 10:30 AM.</para>
        ///   <para>Instead of using a particular date, a day of the week can be specified using the following dates:
        ///   <bulletList>
        ///     <bullet_item>Today—12/30/1899  </bullet_item><para/>
        ///     <bullet_item>Sunday—12/31/1899  </bullet_item><para/>
        ///     <bullet_item>Monday—1/1/1900  </bullet_item><para/>
        ///     <bullet_item>Tuesday—1/2/1900  </bullet_item><para/>
        ///     <bullet_item>Wednesday—1/3/1900  </bullet_item><para/>
        ///     <bullet_item>Thursday—1/4/1900  </bullet_item><para/>
        ///     <bullet_item>Friday—1/5/1900  </bullet_item><para/>
        ///     <bullet_item>Saturday—1/6/1900  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示从原点出发的时间。</para>
        ///   <para>如果选择了基于流量的阻抗属性，则将在此处指定的一天中的时间根据动态流量条件生成解决方案。日期和时间可以指定为 2012 年 5 月 14 日上午 10：30。</para>
        /// 可以使用<para>以下日期指定星期几，而不是使用特定日期：
        ///   <bulletList>
        ///     <bullet_item>今天 - 1899 年 12 月 30 日</bullet_item><para/>
        ///     <bullet_item>星期日—1899年12月31日</bullet_item><para/>
        ///     <bullet_item>星期一 - 1/1/1900</bullet_item><para/>
        ///     <bullet_item>星期二 - 1/2/1900</bullet_item><para/>
        ///     <bullet_item>星期三 - 1/3/1900</bullet_item><para/>
        ///     <bullet_item>星期四—1/4/1900</bullet_item><para/>
        ///     <bullet_item>星期五 - 1/5/1900</bullet_item><para/>
        ///     <bullet_item>星期六 - 1/6/1900</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start Time")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_of_day { get; set; } = null;


        /// <summary>
        /// <para>Network Analyst Layer</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Network Analyst Layer")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_layer { get; set; }


        public MakeODCostMatrixLayer SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}